/*
 * BaseLine.java
 * $Id: $
 *
 * Revision History
 *
 * Date             |  Programmer   |  Notes
 * ----------------------------------------------------------
 * Jul 20, 2009        |      Zhengnan Zhou         |  initial
 * 
 * 
 * **********************************************************
 */
package tofc.chart;

import java.util.List;

import tofc.style.BaseLineStyle;
import tofc.style.BaseDotStyle;
import tofc.value.BaseLineDot;
import java.util.ArrayList;

/**
 * BaseLineChart:
 * 
 * @author		Zhengnan Zhou
 * @version 	$Revision$, Jul 20, 2009
 */
public abstract class BaseLine extends BaseXYChart {

    private String type;
    private String style;
    private List values;
    private Integer width;
    private BaseDotStyle dotStyle;
    private BaseLineStyle lineStyle;
    private String colour;

    public BaseLine() {
        this.values = new ArrayList();
    }

    /**
     * @return type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * @return style
     */
    public String getStyle() {
        return style;
    }

    /**
     * @param style
     */
    public void setStyle(String style) {
        this.style = style;
    }

    /**
     * @return width
     */
    public int getWidth() {
        return width;
    }

    /**
     *
     * @param values
     */
    public void setValues(Number... values) {
        this.values.clear();
        addValues(values);
    }

    /**
     *
     * @param values
     */
    public void addValues(Number... values) {
        for (int i = 0; i < values.length; i++) {
            this.values.add(values[i]);
        }
    }

    /**
     *
     * @param position
     * @param value
     */
    public void setValue(int position, Number value) {
        this.values.set(position, value);
    }

    /**
     *
     * @param dots
     */
    public void addValues(BaseLineDot... dots) {
        for (int i = 0; i < dots.length; i++) {
            this.values.add(dots[i]);
        }
    }

    /**
     *
     * @param dots
     */
    public void setValues(BaseLineDot... dots) {
        this.values.clear();
        addValues(dots);
    }

    /**
     *
     * @param position
     * @param dots
     */
    public void setValue(int position, BaseLineDot dots) {
        this.values.set(position, dots);
    }

    /**
     * add 'null' to the end of the value list
     */
    public void appendNull() {
        this.values.add(null);
    }

    /**
     * set 'null'
     * e.g. values.addValues(1,2,3,4);
     *      values.setNull(2);
     * result: {1,2,null,4}
     * @param index
     */
    public void setNull(int index) {
        this.values.set(index, null);
    }

    /**
     * @return dotStyle
     */
    public BaseDotStyle getDotStyle() {
        return dotStyle;
    }

    /**
     * @param dotStyle
     */
    public void setDotStyle(BaseDotStyle dotStyle) {
        this.dotStyle = dotStyle;
    }

    /**
     * @return lineStyle
     */
    public BaseLineStyle getLineStyle() {
        return lineStyle;
    }

    /**
     * @param lineStyle
     */
    public void setLineStyle(BaseLineStyle lineStyle) {
        this.lineStyle = lineStyle;
    }

    /**
     * @return colour
     */
    public String getColour() {
        return colour;
    }

    /**
     * @param colour
     */
    public void setColour(String colour) {
        this.colour = colour;
    }

    /**
     * @return values
     */
    public List getValues() {
        return values;
    }
}
